package cloudUser.controller;

import cloudEntity.utils.ResultUtils;
import cloudEntity.vo.PageBeanVO;
import cloudEntity.vo.user.SmartUserVO;
import cloudUser.service.SmartUserService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @program: Smart School
 * @ClassName AdminUserController
 * @description: 管理员控制器（包含可以控制用户）
 * @author: 陈智博
 * @create: 2025-05-07 15:29
 * @Version 1.0
 **/
@RestController
@RequestMapping("/sys")
@Tag(name = "管理员控制器")
public class AdminUserController {

    @Autowired
    private SmartUserService smartUserService;

    @Operation(summary = "根据type分页查询所有人员")
    @Parameters({
            @Parameter(name = "t",description = "新闻类型",required = false),
            @Parameter(name = "n",description = "页码",required = false),
            @Parameter(name = "s",description = "条数",required = false)
    })
    @RequestMapping(value = "/select",method = RequestMethod.GET)
    public ResultUtils selectByTypeReturnPageInfo(@RequestParam(value = "t",required = false,defaultValue = "1") Integer type,
                                                  @RequestParam(value = "n",required = false,defaultValue = "1") Integer pageNum,
                                                  @RequestParam(value = "s",required = false,defaultValue = "5") Integer pageSize)
    {
        PageBeanVO<SmartUserVO> smartUserEntityPageBeanVO = smartUserService.GetSmartUserReturnPage(type, pageNum, pageSize);
        return ResultUtils.success(smartUserEntityPageBeanVO);
    }

}
